﻿#pragma once
#include "FatherA.hpp"

class ChildB : public FatherA
{
public:
	ChildB() = default;
	~ChildB() = default;

	void FatherName() {
		std::cout << this->name << std::endl;
	}

	// 由于 FatherA的money成员变量是私有的，子类不能访问
	//void FatherMoney() {
	//	std::cout << this->Money << std::endl;
	//}

	// 由于 FatherA的 Legacy成员变量是protect的，子类可以访问的
	void FatherLegacy() {
		std::cout << this->legacy << std::endl;
	}
private:

protected:
	std::string Money = "Child's money.";

};

